from Constants import *
import pygame
from pygame.locals import *

SIDE_BAR_X = 0
SIDE_BAR_Y = 0
SIDE_BAR_WIDTH=100
SIDE_BAR_HEIGHT=MAP_HEIGHT

class SideBar:
    def __init__(self):
        self.canvas = pygame.Surface((SIDE_BAR_WIDTH, SIDE_BAR_HEIGHT)).convert()
        self.canvas.fill((0,0,0))
        self.puzzles = []
    
    def addPuzzle(self, puzzle):
        self.puzzles.append(puzzle)
    
    def removePuzzle(self, puzzle):
        self.puzzles.remove(puzzle)
    
    def render(self, screen):
        screen.blit(self.canvas, (SIDE_BAR_X, SIDE_BAR_Y))
        for x in self.puzzles:
            x.render(screen, (2,2))